/*********************************************************************
* File: IVision.h
*
* Supports agents' vision.
*********************************************************************/
#pragma once

#include "../globals.h"
#include "../../game/globals.h"
using namespace game;

namespace agents{namespace interfaces{
	/**
	* \class IVision
	* \brief Supports agents' vision.
	*
	* Supports seeing enemies, teammates and objects in the world. 
	*
	* \author Instituto Superior Tecnico de Lisboa, Portugal
	* \author Technical University of Lisbon, Portugal
	* 
	* \author Agentes Autonomos e Sistemas Multiagente
	* \author Autonomous Agents and Multiagent Systems
	* 
	* \version	1.0
	* \date		2006/2007
	**/
	class IVision
	{
	public:
		//=====================================================================
		// Classes
		//=====================================================================
		/**
		* \class IVisibleAgent
		* \brief A visible agent in the world.
		*
		* Defines the information available about the other agents which can 
		* be perceived through vision.
		**/
		class IVisibleAgent
		{
		public:
			/**
			* \brief Gets the agent's name.
			**/
			virtual const char* getName() = 0;
			/**
			* \brief Gets the agent's team.
			**/
			virtual CounterStrikeTeams::Enumeration getTeam() = 0;
			/**
			* \brief Gets the agent's position.
			**/
			virtual Vector getPosition() = 0;
			/**
			* \brief Gets the agent's body part position.
			*
			* \param[in] bodyPart The body part. 
			**/
			virtual Vector getBodyPartPosition(BodyPart::Enumeration bodyPart) = 0;
			/**
			* \brief Gets the agent's primary weapon.
			**/
			virtual WeaponIds::Enumeration getPrimaryWeapon() = 0;
			/**
			* \brief Gets the agent's secondary weapon.
			**/
			virtual WeaponIds::Enumeration getSecondaryWeapon() = 0;
			/**
			* \brief Whether the agent is a human player.
			**/
			virtual bool isHumanPlayer() = 0;
			/**
			* \brief Gets the agent's health.
			* 
			* Agents can only see health of teammates.
			**/
			virtual int getHealth() = 0;
		};

		/**
		* \class PickableWeapon
		* \brief A weapon lying on the floor.
		*
		* Defines the information available about weapons on the floor 
		* which can be perceived through vision.
		**/
		class PickableWeapon
		{
		public:
			/**
			* \brief The weapon id.
			**/
			WeaponIds::Enumeration weapon;
			/**
			* \brief The weapon position.
			**/
			Vector position;
		};

		//=====================================================================
		// Function prototypes
		//=====================================================================
		/**
		* \brief The agent's field-of-view in degrees.
		**/
		virtual float getFieldOfView() = 0;
		/**
		* \brief Whether a point in the world is visible.
		*
		* Considers obstacles and the agent's field-of-view.
		**/
		virtual bool isPointVisible(Vector point) = 0;
		/**
		* \brief Gets the visible teammates. 
		*
		* Considers obstacles and the agent's field-of-view.
		*
		* \param[out] count The number of visible teammates.
		* \return The list of visible teammates.
		**/
		virtual IVisibleAgent** seeTeammates(int* count) = 0;
		/**
		* \brief Gets the visible enemies. 
		*
		* Considers obstacles and the agent's field-of-view.
		*
		* \param[out] count The number of visible enemies.
		* \return The list of visible enemies.
		**/
		virtual IVisibleAgent** seeEnemies(int* count) = 0;
		/**
		* \brief Gets visible weapons o the floor. 
		*
		* Considers obstacles and the agent's field-of-view.
		*
		* \param[in] weapons The list of weapons.
		* \param[in,out] count Pass the maximum number of weapons to perceive as argument. 
		* Is set to actual number of weapons found.
		**/
		virtual void seeWeaponsOnTheFloor(PickableWeapon* weapons, int* count) = 0;

		/**
		* \brief Whether the armed bomb is visible.
		*
		* \param[out] position The bomb position.
		**/
		virtual bool isArmedBombVisible(Vector* position) = 0;
		/**
		* \brief Whether the bomb on the floor is visible.
		*
		* \param[out] position The bomb position.
		**/
		virtual bool isDroppedBombVisible(Vector* position) = 0;
		/**
		* \brief Whether the bomber is visible.
		*
		* \param[out] bomber The agent.
		**/
		virtual bool isBomberVisible(IVisibleAgent* bomber) = 0;

		/**
		* \brief Whether an agent damage this agent.
		*
		* \param[in] shooter The possible shooter.
		**/
		virtual bool inflictedDamage(IVisibleAgent* shooter) = 0;

		/**
		* \brief Whether a HE grenade is visible.
		*
		* \param[out] position The grenade position.
		**/
		virtual bool isHeGrenadeVisible(Vector* position) = 0;
		/**
		* \brief Whether a smoke grenade is visible.
		*
		* \param[out] position The grenade position.
		**/
		virtual bool isSmokeGrenadeVisible(Vector* position) = 0;
		/**
		* \brief Whether a flashbang is visible.
		*
		* \param[out] position The flashbang position.
		**/
		virtual bool isFlashbangVisible(Vector* position) = 0;
	};
}}
